begintalkscript;
variables;


begintalknode 1;
state = -1;
nextstate = 1;
question = "James";
condition = 1;
text1 = "The innkeeper is clearly an Avernite. He has got a grey hair and a pale skin.";
text2 = "_Hello, adventurers, and welcome to my humble inn. You can call me James._";
action = INTRO;
text5 = "_Yes, what else do you want?_";

begintalknode 2;
state = 1;
nextstate = 1;
condition = 1;
question = "Why are there so many Avernites around?";
text1 = "_You see, we got bored pretty fast in the forests of the Southern Valorim. We wanted to sail the sea._";
text2 = "_And this Delta is almost as remote as the forests, so you won't become an offer of racism._";
text3 = "_Speaking of racism, it is common near the centre of the Empire. They hate us 'palefaces' and some rumors say that they bounty hunt us._";

begintalknode 3;
state = 1;
nextstate = 2;
condition = 1;
question = "Do you serve drinks here?";
text1 = "_Yes. We have traditional Avernite fungus beer. Want some? Only 7 coins one round._";

begintalknode 4;
state = 2;
nextstate = -1;
condition = 1;
question = "I'll take one round. (Pay 7 coins)";
text1 = "_Okay, here you are._ The Avernite fungus beer is extremely bitter. You get drunk.";
code = change_coins(-7);
       set_char_status(1000, 28, 10, 0, 1);
break;

begintalknode 5;
state = 1;
nextstate = 3;
condition = 1;
question = "What rations do you have for sale?";
text1 = "_We have fish. Not real cave fish, however. But we do have real Avernite mushrooms._";
text2 = "_Would you like to buy some?_";
code = begin_shop_mode("Avernite foods", "There are a variety of Avernite foods available. Avernite food tends to be very rare on the surface world.", 19, 0, -1); 
break;

begintalknode 6;
state = 1;
nextstate = 4;
condition = 1;
question = "This is an inn, isn't it? I would like to stay over night.";
text1 = "_That will do fine. It costs 12 coins._";

begintalknode 7;
state = 4;
nextstate = -1;
condition = 1;
question = "All right! (Pay 12 coins)";
action = INN 12 30 42;
text1 = "_I hope you like the beds. They're of great quality._";
text3 = "_Nononononono! I will not let you in. I won't let in anyone who can't afford to pay rightaway._";
text5 = "_Please leave your horses outside and come back._";








begintalknode 10;
state = -1;
nextstate = 5;
condition = 1;
question = "Jerry";
text1 = "There is a merchant sitting here with the nephilim, drinking beer. When he notices you he tells you to come and sit down with him.";
text2 = "_Hello, who-ever-you-are. Me, I am Jerry. Look, could you do me a favor?_ For some reason he whispers.";
action = INTRO;
text5 = "_Hello._";

begintalknode 11;
state = 5;
nextstate = 5;
condition = 1;
question = "Are you a good friend of the nephilim?";
text1 = "_Yes! They are very nice people. They know the best jokes and stories. And they aren't at all as violent as many think._";

begintalknode 12;
state = 5;
nextstate = 6;
condition = get_flag(119, 12) == 0;
question = "What is the favor you want me to do?";
text1 = "_I just want you toLook, I'd better tell you the whole story. Well, I am one of the very few who own a boat here. Occasionally some people get jealous about it._";
text2 = "_I had this little argument with one of these furry friends, and Ihmmmmmade a little bet that I would find someone who wants a ride to the Alchemist's Lab today._";
text3 = "_So, could you ask me to take you there?_";

begintalknode 13;
state = 6;
nextstate = 7;
condition = 1;
question = "If I do it, will you take me there really?";
text1 = "_Well, okay!_";

begintalknode 14;
state = 7;
nextstate = -1;
condition = 1;
question = "So, _Will you take me to the Alchemist's Lab?_";
text1 = "_Why of course! Go to the middle dock outside._ You notice that one of the nearby nephilim spits.";
code = set_flag(119, 12, 2);
       //move_to_new_town(11, 20, 25);
       end();
break;

begintalknode 15;
state = 5;
nextstate = 5;
condition = get_flag(119, 27) == 1;
question = "You are nephil fodder.";
text1 = "_Why you slimy smellyWait a second. You've been talking with Graham, haven't you?_";
text2 = "_I'd better revenge. You go tell him that he is a ship termite._";
code = set_flag(119, 27, 2);
break;

begintalknode 16;
state = 5;
nextstate = -1;
condition = get_flag(119, 12) == 1;
question = "Can you take me to the Alchemist's Lab?";
text1 = "_Sure!_";
code = set_flag(119, 12, 2);
       move_to_new_town(11, 20, 25);
break;




begintalknode 18;
state = -1;
nextstate = 10;
question = "Schazam";
condition = 1;
text1 = "There is a slith living here. Slithzerikai are extremely rare on the surface world. This one is, however, friendly.";
text2 = "She greets you in their own typical way with a long, high-pitched hiss. _SSSSSSSsssssssssss. I am Schazam. I am pleased to meet more surface people._";

begintalknode 19;
state = 10;
nextstate = 11;
condition = 1;
question = "Do you like living on the surface?";
text1 = "_Yesssssssss. It is so warm here. And there is this wonderfulgrasssssssss is what you call it. It is so soft and comfortable to walk on. But there are things that we miss about Avernum._";

begintalknode 20;
state = 11;
nextstate = -1;
condition = 1;
question = "What things?";
text1 = "_The fisssssssssssh! The delicious cave fish. You can't get it anywhere else._";

begintalknode 21;
state = 10;
nextstate = 12;
condition = 1;
question = "Why did you choose to come here?";
text1 = "_We had no other place to come to. We were slaves to other sliths. They were going to sacrifice us, I think. We had no home there, so we joined the Avernites and came up here._";

begintalknode 22;
state = 12;
nextstate = 13;
condition = 1;
question = "Are there many more of you 'friendly' sliths?";
text1 = "_Not much. However, we aren't going extingt like our good friends, the nephilim. Alas them._";

begintalknode 23;
state = 13;
nextstate = -1;
condition = 1;
question = "Are there many nephilim left in Avernum?";
text1 = "_No, not many. But there are those who are friends to the humans there. If the nephilim lost their hope of a future on the surface, it is Avernum wherw they will have to go._";
text2 = "_I've heard rumors that they are breeding in Avernum again. Perhaps their race can be saved._";





begintalknode 25;
state = -1;
nextstate = 15;
condition = 1;
question = "Graham";
text1 = "The shopkeeper is a musculous man with black hair. He seems to be unhappy.";
text2 = "_Oh, hello. Call me Graham. I'm sorry, but right now I would not like to have anything to do with others._";

begintalknode 26;
state = 15;
nextstate = 16;
condition = 1;
question = "Why are you upset?";
text1 = "_I haven't got any boats to sell. They are very popular around here nowadays. I would build some, but I don't have any materials._";
text2 = "_Curses to that brotherhood of(SPIT)Nelphis! Without them scaring my lumberjacks out of the woods I would be selling well._";
text3 = "_And on top of that there is this Jerry._";

begintalknode 27;
state = 16;
nextstate = -1;
question = "Who is Jerry?";
condition = get_flag(119, 27) == 0;
text1 = "_He is a merchant who loves fungus beer. He is one of the few with a boat around here. He thinks that he is tough with his rowboat._";
text2 = "_Could you do me a favor? Go tell him that he is nephil fodder! That'll teach him. Now go!_ He asks you to leave.";
action = END_TALK;
code = set_flag(119, 27, 1);
break;

begintalknode 28;
state = 16;
nextstate = 16;
condition = 1;
question = "Tell me about the Nelphis brotherhood.";
text1 = "_You wouldn't want to have anything to do with them. 'Guardians of the nature'. Phaugh! Stay away from them._";

begintalknode 29;
state = 15;
nextstate = 15;
condition = 1;
question = "Have you got any boats?";
text1 = "_No! And I will not get any for a while. So don't come here next time when you want to buy a rowboat._";

begintalknode 30;
state = 15;
nextstate = -1;
condition = get_flag(119, 27) == 2;
question = "You are a ship termite.";
text1 = "_What did you call me?! For this I will make you beg that I'd mercy-kill you!_";
action = END_TALK;
code = set_attitude(character_talking_to(), 10);
break;